import 'package:flutter/material.dart';
import 'package:get/get.dart';
import 'package:getx_tutorial/app/modules/state/dependency_find/counter_controller.dart';

class NextPage extends GetView {

  final c = Get.find<CounterController>();

  @override
  Widget build(BuildContext context) {

    return Scaffold(
      appBar: AppBar(
        title: Text('NextPage'),
        centerTitle: true,
      ),

      body: SafeArea(
        child: ListView(
          children: [
            GetX<CounterController>(
              init: c,
              builder: (_) {
                return Text(
                  'X: '+_.x.value.toString(),
                  style: Theme.of(context).textTheme.headline5
                );
              }
            )
          ]
        )
      )
    );
  }
}